function setupLinkage(){
    const data = {
        "北京":["东城","西城","南城","北城"],
        "天津":["东城","西城","南城","北城"],
        "河北":["石家庄","唐山","秦皇岛","邯郸","邢台","保定","张家口","承德","沧州","廊坊","衡水"],
        "山西":["太原","大同","阳泉","长治","晋城","朔州","晋中","运城","忻州","临汾","吕梁"],
    };
    const province = document.getElementById('province');
    const city = document.getElementById('city');

     
    // 填充省份
    Object.keys(data).forEach(p => {
        province.innerHTML += `<option value="${p}">${p}</option>`;
    });
    
    // 省份变化事件
    province.onchange = function() {
        const cities = data[this.value] || [];
        city.innerHTML = cities.map(c => `<option value="${c}">${c}</option>`).join('') || '<option>-- 请选择 --</option>';
    };
}

    document.addEventListener('DOMContentLoaded',setupLinkage);

